package com.rany.day06.demo06;

public class StringBuilderToString {
    public static void main(String[] args) {
        String str = "hello" ;
        System.out.println(str);
        //将字符串变成字符串缓冲区
        StringBuilder stringBuilder = new StringBuilder(str);
        //用append方法增加内容
        stringBuilder.append("world");
        System.out.println(stringBuilder);
        //利用toString方法将缓冲区内容变为string内容
        String s = stringBuilder.toString();
        System.out.println(s);
    }
}
